<template>
  <topbar>
    <topbar-item path="/home" class="item-img">
      <template v-slot:item>
        <div>
          <img src="~assets/img/logo/u2.png" alt="" />
          <img src="~assets/img/logo/img_5715(1).png" class="logoImg2" alt="" />
        </div>
      </template>
    </topbar-item>
    <div class="item-flex">
      <topbar-item path="/home" class="item-text item-dh">
        <template v-slot:item>
          <div>
            <span>自动蹲号</span>
          </div>
        </template>
      </topbar-item>
      <el-divider direction="vertical"></el-divider>
      <topbar-item path="/accountLocal" class="item-text item-accountLoacl">
        <template v-slot:item>
          <div>
            <span>本地账号</span>
          </div>
        </template>
      </topbar-item>
      <el-divider direction="vertical"></el-divider>
      <topbar-item path="/wbStorey" class="item-text item-wbl">
        <template v-slot:item>
          <div>
            <span>万宝楼</span>
          </div>
        </template>
      </topbar-item>
      <el-divider direction="vertical"></el-divider>
      <topbar-item path="/accountSearch" class="item-text item-accountSearch">
        <template v-slot:item>
          <div>
            <span>贴吧搜号</span>
          </div>
        </template>
      </topbar-item>
      <el-divider direction="vertical"></el-divider>
      <topbar-item class="item-text item-accountPrice">
        <template v-slot:item>
          <div>
            <span
              ><el-button type="text" @click="open">账号估价</el-button></span
            >
          </div>
        </template>
      </topbar-item>
    </div>
    <span class="mydivider"></span>
    <topbar-item path="/user/login" class="item-log-in" v-show="isLogin">
      <template v-slot:item>
        <div>
          <p>登录</p>
        </div>
      </template>
    </topbar-item>
    <topbar-item path="/user/register" class="item-login" v-show="isLogin">
      <template v-slot:item>
        <div>
          <p>注册</p>
        </div>
      </template>
    </topbar-item>
  </topbar>
</template>

<script>
import Topbar from "components/common/topbar/Topbar";
import TopbarItem from "components/common/topbar/TopbarItem";

export default {
  name: "MainTabbar",
  data() {
    return {
      isLogin: true,
    };
  },
  components: {
    Topbar,
    TopbarItem,
  },
  methods: {
    open() {
      this.$prompt("请输入估价账号", "精选活动--账号估价", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        inputPattern: /[0-9]/,
        inputErrorMessage: "请输入账号",
      })
        .then(({ value }) => {
          this.$message({
            type: "success",
            message: "账号: " + value + "价值：999￥",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "取消估价",
          });
        });
    },
  },
};
</script>

<style scoped>
.item-flex {
  display: flex;
  width: 600px;
  margin-left: 393px;
  /*主轴上的对齐方式为居中*/
  justify-content: center;
  /*交叉轴上对齐方式为居中*/
  align-items: center;
}
.item-img {
  width: 270px;
  display: inline;
  float: left;
  cursor: pointer;
}
.logoImg2 {
  margin-left: 20px;
}
.item-text {
  font-size: 14px;
  height: 75px;
  flex: 1;
  line-height: 75px;
  cursor: pointer;
}
.item-text:hover {
  background: linear-gradient(to bottom, #111111, #1e2022);
}
.item-text:hover span {
  border-bottom: 2px solid rgb(250, 76, 29);
  padding-bottom: 13px;
}
.el-divider {
  background-color: #434343;
}
.el-divider--vertical {
  margin: 0 0;
}
.item-login {
  line-height: 29px;
  font-size: 14px;
  height: 29px;
  width: 50;
  position: absolute;
  right: 23px;
  top: 20px;
  color: #f4f4f4;
  cursor: pointer;
}
.item-log-in {
  line-height: 29px;
  font-size: 14px;
  height: 29px;
  width: 72px;
  position: absolute;
  right: 72px;
  top: 20px;
  background-color: rgb(250, 76, 29);
  border-radius: 16px;
  color: #f4f4f4;
  cursor: pointer;
}
.mydivider {
  background-color: #626262;
  display: inline-block;
  width: 1px;
  height: 29px;
  vertical-align: middle;
  position: absolute;
  right: 185px;
  top: 20px;
}
.el-button--text {
  color: #979797;
}
.el-button--text:focus,
.el-button--text:hover {
  color: #979797;
}
</style>